<template>
  <div class="message-content">
    <el-scrollbar>
      <div v-if="message" class="message-item">
        <h3>{{ message.title }}</h3>
        <p>{{ message.content }}</p>
      </div>
      <div v-else class="no-message">
        <p>请选择一条消息查看内容</p>
      </div>
    </el-scrollbar>
  </div>
</template>

<script setup>
const props = defineProps({
  message: Object
})
</script>

<style scoped>
.message-content {
  flex: 1;
  padding: 20px;
}

.message-item {
  background-color: #f9fafc;
  padding: 20px;
  border-radius: 4px;
}

.no-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
</style>